<template>
  <section>
    <swiper :options="swiperOption"  class="slider">
      <swiper-slide v-for="(item,index) in items" :key="index">
        <router-link :to="{name:item.href}">
          <img :src="item.imgUrl" class="slider-img">
        </router-link>
      </swiper-slide>
      <div class="swiper-pagination"  slot="pagination"></div>
    </swiper>
  </section>
</template>

<script>
export default {
  name: 'coreSlider',
  props: {
    swiperOption: {
      type: Object,
      default () {
        return {
          autoplay: false,
          loop: true,
          pagination: '.swiper-pagination'
        }
      }
    },
    items: {
      type: Array,
      default () {
        return []
      }
    }
  },
  data () {
    return {
    }
  }
}
</script>

<style lang="stylus" scoped>
   .slider-img
    width:100%
</style>
